package tank;

import java.awt.*;

/**
 * @Auther: fei
 * @Date: 2021/6/9 - 06 - 09 - 17:16
 * @Description: tank
 * @version: 1.0
 */
public class Explode {
    private int x,y;
    private TankFrame tf;

    public static int WIDTH = ResourceMgr.explode.getWidth();
    public static int HEIGHT = ResourceMgr.explode.getHeight();
    //计算爆炸的宽度和高度

    private int step = 0;
    private boolean living = true; //爆炸是否在存活期


    public Explode() {
    }

    public Explode(int x, int y,  TankFrame tf) {
        this.x = x;
        this.y = y;
        this.tf = tf;
    }

    public void paint(Graphics g){

        g.drawImage(ResourceMgr.explode,x,y,null);

        //20步后移除爆炸
        step++;
        if(step > 20){
            tf.explode.remove(this);
        }

    }


}
